from django.db import models
from commodity.models import Commodity
from apps.user.models import User_info
# Create your models here.

class Order(models.Model):
	order_no = models.TextField(verbose_name='订单号')
	money = models.FloatField()
	subject = models.TextField(verbose_name='商品信息')
	status = models.SmallIntegerField(default=0)
	c_time = models.DateTimeField(verbose_name='创建时间',auto_now_add=True)
	u_time = models.DateTimeField(verbose_name='更新时间',auto_now=True)
	commodity = models.ForeignKey(Commodity,verbose_name='商品ID',on_delete=models.CASCADE)
	user = models.ForeignKey(User_info,verbose_name='用户ID',on_delete=models.CASCADE)
	
	class Meta:
		db_table = 'order'